package com.thomsonreuter.search.compare;

import com.thomsonreuter.search.compare.comparision.ElasticComparator;
import com.thomsonreuter.search.compare.config.PropertyConfig;
import com.thomsonreuter.search.compare.constants.CompareConstants;

import java.io.IOException;

public class indexcomparison {

    public static void main(String[] args){
        if(args.length < 3){
            System.out.println("Running this compare program need two parameters, one is the source index URL, the other is the compared index URL. All the URLs should be full path.Make sure you have input these two params.");

            System.exit(-1);
        }
        String from = args[0];
        String to = args[1];
        String sampleSize = args[2];
        PropertyConfig.getInstance().setProperties(CompareConstants.SAMPLE_SIZE,sampleSize);
        ElasticComparator comparator = new ElasticComparator();
        try {
            comparator.compare(from, to);
        } catch (IOException e) {
            System.out.println("Comparison failed.");
            e.printStackTrace();
        }

    }
}
